home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
038a
/
ds31.zip
/
DOORSORC.DOC
next >
Wrap
Text File
|
1990-11-04
|
65KB
|
1,647 lines
▓▒░ Door Source ░▒▓
▓▒░ Version 3.1 ░▒▓
September 16, 1990
Todd Miller
Copyright 1988, 1989, 1990
Computer City, USA
PC-Technologies BBS - Greensboro, NC
Node 1 - (919) 299-7935 300/1200/2400/9600 USR
Node 2 - (919) 294-1770 300/1200/2400
Door Source 3.1
Programmer's Manual
Table Of Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . 1
Disclaimer . . . . . . . . . . . . . . . . . . . . . . . . 2
Using Door Source . . . . . . . . . . . . . . . . . . . . . 3
Configuration File . . . . . . . . . . . . . . . . . . . . 4
Before you get started . . . . . . . . . . . . . . . . . . 5
Routines
AllTrun . . . . . . . . . . . . . . . . . . . . . . . . 6
ANSIMusic . . . . . . . . . . . . . . . . . . . . . . . 7
BackSpaceOver . . . . . . . . . . . . . . . . . . . . . 8
BeepSpeaker . . . . . . . . . . . . . . . . . . . . . . 9
Center . . . . . . . . . . . . . . . . . . . . . . . . . 10
ClrScrn . . . . . . . . . . . . . . . . . . . . . . . . 11
ColorEasy . . . . . . . . . . . . . . . . . . . . . . . 12
DoorBusy . . . . . . . . . . . . . . . . . . . . . . . . 13
ErrorLevelSet . . . . . . . . . . . . . . . . . . . . . 14
ExitDoor . . . . . . . . . . . . . . . . . . . . . . . . 15
FileExist . . . . . . . . . . . . . . . . . . . . . . . 16
GetTime . . . . . . . . . . . . . . . . . . . . . . . . 17
HighScores . . . . . . . . . . . . . . . . . . . . . . . 18
Incomm . . . . . . . . . . . . . . . . . . . . . . . . . 19
MenuManager . . . . . . . . . . . . . . . . . . . . . . 20
MoveCursor . . . . . . . . . . . . . . . . . . . . . . . 21
NL . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Parser . . . . . . . . . . . . . . . . . . . . . . . . . 23
RandNum . . . . . . . . . . . . . . . . . . . . . . . . 24
ReadUsers . . . . . . . . . . . . . . . . . . . . . . . 25
Send . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Sorter . . . . . . . . . . . . . . . . . . . . . . . . . 27
SysopPage . . . . . . . . . . . . . . . . . . . . . . . 28
TimeConvert . . . . . . . . . . . . . . . . . . . . . . 29
ViewFile . . . . . . . . . . . . . . . . . . . . . . . . 30
WaitASec . . . . . . . . . . . . . . . . . . . . . . . . 31
Windows . . . . . . . . . . . . . . . . . . . . . . . . 32
WriteUsers . . . . . . . . . . . . . . . . . . . . . . . 33
Door Source 3.1
Programmer's Manual
Table Of Contents (Cont.)
Script Commands . . . . . . . . . . . . . . . . . . . . . . 34
Variables . . . . . . . . . . . . . . . . . . . . . . . . . 47
Programming a Door with Door Source 3.1
Beginning your program . . . . . . . . . . . . . . . . . 49
Terminating your program . . . . . . . . . . . . . . . . 49
Loading QuickBasic 4.5 . . . . . . . . . . . . . . . . . 49
Compiling, Linking, and executing your Door . . . . . . 50
Support of several bbs types . . . . . . . . . . . . . . 50
Door Source Tips . . . . . . . . . . . . . . . . . . . . . 51
ANSI Graphics and Color . . . . . . . . . . . . . . . . 51
Paging the sysop . . . . . . . . . . . . . . . . . . . . 51
Some NEVERs . . . . . . . . . . . . . . . . . . . . . . 52
Door Source 3.1 in operation . . . . . . . . . . . . . . . 53
Door Source History and Credits . . . . . . . . . . . . . . 54
Problems and Copyrights . . . . . . . . . . . . . . . . . . 55
Door registration and license agreement forms . . . . . . . 56
A look ahead in the next version . . . . . . . . . . . . . 57
Door Source 3.1 - Page 1
Programmer's Manual
Introduction
Door Source has always been designed with three things in mind.
Number one is easy of programming for you, cutting no corners, cutting
size of your programs, and your suggestions. Number two is space
optimization. Door Source tries to keep the space of your programs and
itself small to allow you to have even more room to program your doors!
Number three is the people who will use doors made with Door Source.
We try to keep any crude errors exploding on a user,which weren't
supposed to be there. We try to keep it looking clean, smooth, and
working fast. There is door writing utility for QuickBasic 3.1, it
covers most all of what you would do in a door. But we are taking it
a step farther, we are creating a new standard. Since QuickBasic 4.5
is becoming more widly wanting to be used, we let you use QuickBasic 4.5.
That's the ONLY version of the QuickBasic Editors that this will work
with. Of course it should work with anything above 4.5 too. Door Source
has some very hard to crack security codes at your disposal. Door Source
is open to you for your use. You do NOT need to pay US any money to
write a door with door source. Here are some of Door Source's new
features!
* Handles comm port by assembly interrupt routines.
* A routine to Trunacate all spaces on both ends.
* Two routines to check if there is a character waiting in the
communacations port or keyboard buffer.
* Three routines to give information on time and date.
* A sysop page routine.
* Four security routines to encode and decode a string.
* A viewfile routine to show ANSI and NON-ANSI files.
* A pop-up window and ANSI scroll bar routines!
* Support for bauds up to 52,600 bps!
* Properly credits chat time to caller's time left.
* Always checking for a loss of carrier.
* Supports PCBoard 14.x, PCBoard 11.x and 12.x!
* A formated printing routine to format large, ugly numbers!
* Handles networking and locking ports
Door Source 3.1 - Page 2
Programmer's Manual
Disclaimer
We assume no liability for Door Source's use. You may copy it and
share it with others as long as the code and the documentation are
distributed together unmodified. You may include this logic in as many
door programs as you wish as long as you register each door with us
free of any charges and have a Door Source License. This entire
package is copyrighted and it is unlawful to disassemble or otherwise
decode or misuse the software contained herein. It is for your use in
programming doors and may not be altered in any way. You may not charge
a fee for its use or sell it. Door Source 3.1 is to be distributed in
it's ORIGINAL form and contain ALL of the original files unmodified.
We can not be held liable for any damages or losses of any type. It's
a violation of this disclaimer to distribute any doors without a
Door Source License, which is available at from us at no charge.
Now that that part is over with, let's get on with it!
If you ever have problems with Door Source, please contact me
via my bbs at 919 299-7935 and 919 294-1770. I want to help and
I want all of your good suggestions about Door Source.
Door Source 3.1 - Page 3
Programmer's Manual
Using Door Source
One of the main advantages of Door Source is it's easy of use.
You can write a good looking professional door in just a couple of
hours. In order to use Door Source, you will be needing a copy of
QuickBasic 4.5, and you can use the already patched BRUN45.EXE that
we included in the zip. If you have door source set up in a different
directory than QuickBasic is, type this line before loading QuickBasic:
SET LIB=(drive and path)
This will tell QuickBasic where the Door Source libary is. You might
also want to have a copy of the PCBOARD.SYS in local mode handy. You
can get one of these by siging on locally and going to any one of
the doors you have already online. Then once it starts the batch file,
you should terminate it by using Ctrl-Break. Then simply copy the file
over to your QuickBasic directory and return to the bbs by typing
BOARD. Since DoorSource is a libary for QuickBasic 4.5, you can test
your program by running it right in QuickBasic instead of having to
go through the long compling process. This will be discussed in
Programming a door with Door Source 3.1, under the sub-title, Loading
QuickBasic 4.5.
What should be in the zip you received is:
DOORSORC.DOC - Documentation that you are reading now.
DOORSORC.LIB - One form of the library that QuickBasic 4.5 needs.
DOORSORC.QLB - The other form that QuickBasic 4.5 needs.
DOORSORC.INT - A file to be included in your door.
README .NOW - A readme file giving some extra credits.
MENUDEMO.BAS - A Demo of the Menu Manager routine
WINDDEMO.BAS - A Demo of the Window routine
EXAMPLE .CFG - An example of a door's configuration file.
LOADQB .BAT - A quickloading batch file to make life easier.
BRUN45 .EXE - The patched BRUN module for QuickBasic 4.5.
These two files are not included in this version.
DSQUICK .EXE - A TSR pop-up command reference for Door Source
DSQUICK .SLB - A file needed by DSQUICK. Keep in your QB
directory or whereever you use DSQUICK
Door Source 3.1 - Page 4
Programmer's Manual
Configuration File
The configuration file's first four lines is setup up exactly like
most other doors. It should be:
Full Drive\Path\and name of PCBOARD.SYS
BBS'S name
Sysop's First name
Sysop's Last name
A example of this when filled out would be:
C:\PCB\PCBOARD.SYS
PC-Technologies
Todd
Miller
The file will be read into the computer in the included file. It
will be left open for you, so if you need any extra pramaters for
your program, you may add those on after the included file and
always besure to close it. It is always going to be file number one.
Door Source 3.1 - Page 5
Programmer's Manual
Before You Start
A couple of things before you get programming. The library is written
with NO DEFINT A-Z commands in it. If you use a DEFINT A-Z or and DEFs
in your program, you must use the QB variable default (Single Precision)
when passing arguments to a Door Source routine. (Use the ! symbol)
Make sure you read through the commands before you start, it will
help you jump into it faster.
Routines
All the routines that will be shown here follow a standard format.
It will contain the routine's name, variables, description, and an
example. Also check the Script Commands section of the manual for
9 additional sub routines.
Door Source 3.1 - Page 6
Programmer's Manual
Name : AllTrun
CALL AllTrun(Text$)
AllTrun is a routine to strip all leading and trailing spaces
off of the string to give it. The string passed is returned
with the updated striped string.
Example:
Text$=" Some spaces "
CALL AllTrun(Text$)
Door Source 3.1 - Page 7
Programmer's Manual
Name : ANSIMusic
CALL ANSIMusic(Music$, Music.On)
ANSIMusic will send music to the remote user, if music is enabled.
It will also play the music to the local computer if the page bell
is on.
Example:
(Ask user if they can support ANSI music)
.
.
Music$="ABCDABDEA"
CALL ANSIMusic(Music$, Music.On)
Door Source 3.1 - Page 8
Programmer's Manual
Name : BackSpaceOver
CALL BackSpaceOver
BackSpaceOver will start from the current position and back space
over all the characters back to column number 1. This will add
a nice clean up effect to any user (Ansi or non-ansi). It is used
in the Press Enter and More prompts in the program.
Example:
(Print something out)
.
.
CALL BackSpaceOver
Door Source 3.1 - Page 9
Programmer's Manual
Name : BeepSpeaker
CALL BeepSpeaker
BeepSpeaker will beep the remote speaker, and the local speaker too if
the page bell is on.
Example:
CALL BeepSpeaker
Door Source 3.1 - Page 10
Programmer's Manual
Name : Center
CALL Center(Text$)
Center will set the TabSpace variable for Send, so when you call send
the string will be spaced the right amount to appear centered. It will
NOT print the string out, only set it up so Send will space it right.
This is done so you can modify the string (color or add more text)
however you want to.
Example:
Text$="This string will be centered after Send has been called."
CALL Center(Text$)
Door Source 3.1 - Page 11
Programmer's Manual
Name : ClrScrn
CALL ClrScrn
ClrScrn is the same as CLS, but will update the status bar, clear the
remote screen, and clear the local screen. DO NOT USE CLS EVER! The
use of CLS can cause unknown problems with the door.
Example:
CALL ClrScrn
Door Source 3.1 - Page 12
Programmer's Manual
Name : ColorEasy
CALL ColorEasy(Text$, Foreground, Yes)
ColorEasy will color a string colorfully and output it at the same
time. This routine is UNAFFECTED by TabSpace, so centering text
to be used with ColorEasy will NOT work. Different foreground
colors will produce different effects, experiment with it. The high-
intensity colors work and look better with this routine. The YES on
the end is telling the routine if you want it to send a enter after
it is done colorizing and printing the string. A NO will cause no
enter to be sent.
NOTICE: This routine can be a *little* more sluggish than I would like
it to be. I've done the best I can to speed it up, and am
working on a faster version of it
Example:
Text$="Colorize THIS string!! (All characters have a color!)"
CALL ColorEasy(Text$, 12, Yes)
Door Source 3.1 - Page 13
Programmer's Manual
Name : DoorBusy
CALL DoorBusy
DoorBusy is a routine that will check for a file existing in the
current directory, if it finds it, it will asume another node is
using the door, if not, it will create it so other nodes can't use
the door at the same time. This routine is useful if the door your
programming won't be able to support two people on at the same time.
The file will automatically be erased when you call ExitDoor. The
file that tells the door that another node is using the door is
stored in BUSYFILE$. This routine will automatically call ExitDoor
if the BUSYFILE$ is found.
Example:
CALL DoorBusy
Door Source 3.1 - Page 14
Programmer's Manual
Name : ErrorLevelSet
CALL ErrorLevelSet(ErrorCode%)
ErrorLevelSet will allow you to use the DOS ERRORLEVEL batch
sub-command. You can pass a number from 0 to 255 to this routine
at anytime in your program and it will set the errorlevel. This
routine will not call automatically call ExitDoor, you will have
to do that so we can provide more flexiablity. The number passed
to this routine *MUST* be in INTEGER form.
Example:
CALL ErrorLevelSet(1)
Door Source 3.1 - Page 15
Programmer's Manual
Name : ExitDoor
CALL ExitDoor
ExitDoor is a routine to wrap up all of the communacations handling,
hold the DTR and update the SYS file(s). Do NOT just END your program!
If you do, you will drop carrier on the user and the latest settings
(Page bell, Sysop on next, ect) will not be saved! If you wish to
drop carrier, and recycle the bbs, call ExitAndRecycle (Which is
not in this version but will be added next time).
Example:
CALL ExitDoor
Door Source 3.1 - Page 16
Programmer's Manual
Name : FileExist
A = FileExist("COMMMAND.COM")
FileExist a function that works exactly the same as the EXIST
script command, but this works as a function and returns
a numerical value instead of a letter, making it easier to use
this routine "on the fly". Simply pass it the name of the file
and it will return a non-zero value if it exist (TRUE) or a
one (1) if it doesn't exist (FALSE).
Example:
IF FileExist("COMMAND.COM") THEN
CALL Send("Command.Com present",No,Yes,12)
ELSE
CALL Send("Command.Com not found",No,Yes,12)
END IF
Door Source 3.1 - Page 17
Programmer's Manual
Name : GetTime
CALL GetTime(Hours, Minutes, Seconds, SinceMidnight#)
GetTime will provide you with the current Hour, Minute, and Second so
you won't have to chop up and convert TIME$ yourself. The Seconds
since midnight is also provided and is basically TIMER but with
everything after the decimal point cut off.
Example:
CALL GetTime(Hours, Minutes, Seconds, SinceMidnight#)
Door Source 3.1 - Page 18
Programmer's Manual
Name : HighScores
CALL HighScores(Score.For.Player, HighScoreFile$)
HighScores is a routine that will take the score for the current
user, update or add his/her score to a high score file, and finally
sort and print a high score listing. The listing will be centered,
and no header is printed so you can make your own.
Example:
HighScoreFile$
(Calculate score for player on-line)
.
.
(Print a header)
CALL HighScores(Score.For.Player, HighScoreFile$)
Door Source 3.1 - Page 19
Programmer's Manual
Name : Incomm
CALL Incomm(Text$, No, No, 14)
Incomm is a routine to output a line of text and then wait for a
response. Incomm is NOT affected by Tabspace, so anything printed
by it will NOT be tabed over (this will be added in a future version).
The first variable (Text$) is the line of text you want to print
as your prompt. The second variable allows you to send a enter BEFORE
inputing the response, and the third tells Incomm if you want to limit
the string, make it a hotkey, or have a unlimited input field. This
will be explained below. The last variable is the color for the prompt,
the text color is always a color 15 (High-intensity white). The input
is returned in the shared variable ARG$.
Special Parameters:
Caps You can specify at the begining of your program that you
would like all input to be automatically converted to caps.
Do this by making a line: CAPS = Yes
This will not be reset unless you do a CAPS = No.
Filter This will filter out all graphics characters, so that a
user can only input A-Z, a-z, and puncuation (!,.,*,ect.)
Making a NORMAL input field
A normal input field is one where you can type as much as you want,
with no limits on the size of the line. Specify a NO or a 0 for the
third variable to do this.
Making a LIMITED input field
A limited input field is one that will let you type as much as
you want, but will stop taking input WITHOUT doing a automatic
enter. This could be useful when you are using random access files
and dont want to cutoff what a user types in when you save it. To
do this, specify the size of the field in the third variable.
Making a HOT KEY input field
A hot key input field is one that allows the user to type one
character and the program will automatically send a enter and
give you the character the user typed. Use Hot.Key in the third
field to do this.
Example:
CALL Incomm("Enter your command:", No, No, 14)
Door Source 3.1 - Page 20
Programmer's Manual
Name : MenuManager
CALL MenuManager(Menu$(), Yes, 10, 5, How.To.Select$, 15, Bar)
MenuManager is a great way to present nice menus to ansi and non-ansi
users. Store the menu selections in an array and pass them in
the first parameter. The second parameter is if you wan the selections
to be centered automatically, and the third is the color for the
selections. The fourth is how many selections there are in the array,
and the fifth is a string telling the user how to select a selection.
The next to last one is the color for the "how to selcet" string and
the last one is a parameter that MenuManager passes back to you telling
you which selection the user selected. The way a user selects a item
on the menu is by pressing + or - to move a highlighting bar, or
they can press the number of the selection instead. Since the
highlighting bar requires ANSI graphics, the non-ansi user has to use
the other way by selecting the number of the selection. A good
"How to make a selection" string is something like this (so it covers
ansi and non-ansi people) :
Use + and - to move bar and Enter to select or type the number
You could also have a line in the program that would set up the string
at the begining after looking at the ANSI variable to tell if the
user was ansi or non-ansi so it would avoid all confusion.
The example is in a program that comes with Door Source, the program
is MENUDEMO.BAS and will demonstrate the menus as long as you have
a config file and a PCBOARD.SYS file on hand.
HOT TIP : Clear the screen before using menu manager using
ClrScrn, just to make sure that both ends are in
sync with locations on the screen and such.
Door Source 3.1 - Page 21
Programmer's Manual
Name : MoveCursor
ANSI ONLY ROUTINE
CALL MoveCursor (14, 20)
MoveCursor is just like the LOCATE command, but will use ansi commands
to set the cursor at a certain position. If your user is non-ansi, the
routine will sense that and will not do anything. Do NOT call LOCATE
ever in your door or you will cause problems with unknown ends. If you
need to locate a cursor for a non-ansi user, you will have to redraw
the screen, just like other door packages. In a future version, the
program will redraw for you. Notice, this is not built into the
Send routine, so the routine can offer more flexiablity.
Example:
CALL MoveCursor (15, 10)
Door Source 3.1 - Page 22
Programmer's Manual
Name : NL
CALL NL(1)
NL (stands for new line/lines) will send a enter or several enters.
The variable is how many enters you want to be sent.
Example:
CALL NL(5)
Door Source 3.1 - Page 23
Programmer's Manual
Name : Parser
CALL Parser("*", Text$, ParArray$(), ErrCode)
Parser will take Text$ and find every occurance of whatever the
first parameter is (in this case its a *). Then it will store what is
inbetween each * and store it in ParArray$. You can't have more than
50 things stored in the array and if you try to store more, it will
return with a 1 in ErrCode. It will also return with a 1 if the string
is no characters long. This could be useful to compact some data and
take it apart again all in one string. For example, you could store
Blue Cards = 10
Red Cards = 5
Yellow Cards = 25
AS
"10*5*25*"
You could see how useful it could be as long as you knew that blue
was first and yellow was last, and ect... But there is no routine YET
to poke something INTO a string like this, so that is up to you.
Example:
(Read in a string from a file)
.
.
CALL Parser("/", Cards$, Array$(), ErrCode)
(Print out the data or use it)
Door Source 3.1 - Page 24
Programmer's Manual
Name : RandNum
A = RandNum(5, 10)
RandNum is a FUNCTION that will generate a random number within
a specified range. The first variable is the lowest number desired
and the second variable is the highest number desired. This routine
will also randomize by the timer so it will give the most random
number it can give.
Example:
A = RandNum(100,200)
B = RandNum(431,624)
.
.
(Print A + B)
Door Source 3.1 - Page 25
Programmer's Manual
Name : ReadUsers
PCBOARD 14.x ONLY
CALL ReadUsers(ErrCode)
ReadUsers will read from the users file (NOT USERS.INF for 14.5) and
return the data gotten from it. These variables are listed farther
down in the documentation. To write back to the file, use WriteUsers.
Please note that Door Source doesn't read automatically from the
users file, so that is why we included this routine.
NOTE to all 14.5 users: It would be better to use ReadUserSYS and
WriteUserSYS since it a better meathod than using direct USERS file
access.
NOTE: Make sure to set UserFile$ to the path/directory/name of
the user file. You could input this from the config file
as a 5th line from it, but Door Source will not read it
and set it for you.
Example:
' $INCLUDE:'DOORSORC.INT'
PROGNAME$="ABCD"
RELEASE$="1.0"
CALL ClrScrn
INPUT #1, UserFile$
CLOSE #1
.
.
.
CALL ReadUsers(ErrCode)
Door Source 3.1 - Page 26
Programmer's Manual
Name : Send
CALL Send(Text$, No, Yes, 15)
Finally, the way to print to the comm port and the screen. This routine
will handle everything you need to do. Do NOT EVER use PRINT in your
program, use this ALWAYS instead. The Text$ is a string to send out
and the second parameter is if you want it to beep the remote speaker
(and local if page bell is on). The third is if you want it to send
a enter after it's done printing. The last is the color for the text.
To print BLINKING text:
You can print blinking text by setting BlinkText to Yes (or 1). Like
this : BlinkText = Yes
It will always be reset to No, after Send has done it's job, for you.
Example:
CALL Send("Hello World!", Yes, Yes, 12)
Door Source 3.1 - Page 27
Programmer's Manual
Name : Sorter
CALL Send(SortArray$(), Number.To.Sort)
Sorter will take the NUMBERS stored in the STRING array and order
them highest to lowest. You need to pass the array in as the first
parameter and how many elements there are to be sorted in the
second parameter.
Example:
(Set up SortArray$)
.
.
SortArray$(1)="5":SortArray$(2)="3":SortArray$(3)="8"
CALL Sorter(SortArray$(), 3)
Door Source 3.1 - Page 28
Programmer's Manual
Name : SysopPage
CALL SysopPage
SysopPage will page the sysop (only if the page bell is on) and allow
a PCBoard type of sysop chat with the user in your door.
Special Parameters:
Not.Around$ A string that you can define (but it has a default)
that will be shown to the user if the page bell is
OFF.
Example:
CALL SysopPage
Door Source 3.1 - Page 29
Programmer's Manual
Name : TimeConvert
CALL TimeConvert(Hours, Minutes, NewTime$)
TimeConvert will take the Hours and Minutes, convert it to regular
time (non-military time) and return it to you in the third parameters.
Use GetTime to get the Hour and Minute easily seperated.
Example:
CALL TimeConvert(Hours, Minutes, NewTime$)
Door Source 3.1 - Page 30
Programmer's Manual
Name : ViewFile
CALL ViewFile("WELCOME", Yes, No, Yes)
ViewFile will view a ansi or non-ansi file and show it to the local
and remote screens. The first parameter is the name and the second
is if you want ViewFile to check for a ANSI version of the file, and
if found and the user is in ansi mode, show them that version of the
screen (The ANSI versions need a G on the end). The third parameter
is if you want more prompts to automatically come up when 23 lines
have been printed. The last parameter is if you want a Press Any Key
to appear at the bottom of the screen once the file has finshed
displaying.
Special Parameters:
You can set File.Missing$ to equal something other than the
default setting when a file is not found that you requested
to view.
Example:
CALL ViewFile(FileName$, No, Yes, No)
Door Source 3.1 - Page 31
Programmer's Manual
Name : WaitASec
CALL WaitASec(5)
WaitASec will wait the number of seconds specified before returning
control to your door. No input or carrier monitoring will be preformed
while this is running. It will simply pause for the time specified.
The speed of the machine will not make a difference on the time it
waits, this routine is based on the internal clock (Timer).
Example:
CALL WaitASec(3)
Door Source 3.1 - Page 32
Programmer's Manual
Name : Windows
NOT RECOMMENDED FOR NON-IBM USERS
CALL Windows(1, 1, 10, 10, 12, 1, 14, 1, 1, Yes, Text$())
First, Windows is a very slow machine, and shouldn't be used too
often. A fast version will appear soon...
Windows will draw a window, with a shadow if specified, and display
text inside of it. This routine will work with Ansi and Non-ansi users,
but a non-IBM user would get wierd characters for the border. The first
parameter is the Upper Lefthand Row of the window and the second
is the Upper Lefthand Column of the window. The third is the lower
righthand row and the fourth is the lower righthand column for the
window. The fifth is the foreground color for the border and the sixth
is the background for the border. The seventh is the TEXT foreground
and the eigth is the TEXT background color. The ninth is the Border
type, the tenth is if you want a shadow, and the last is an array
that contains the text you want displayed in the window.
Here is a way of writing it for quick reference:
CALL Windows(ULR,ULC,LRR,LRC,FORE,BACK,TFORE,TBACK,BORDER,SHADOW,
TEXT$())
Borders:
Border type #1 : Is a single line border
Border type #2 : Is a double line border
Anything higher than 2 is the ASCII character that will be used
for the entire border. Like a 219 (A solid block) would be the
entire border.
Example:
An example is in a program included with the Door Source ZIP. Its
name is WINDDEMO.BAS. Run this with a sample config and a sample
PCBOARD.SYS and look at it.
Door Source 3.1 - Page 33
Programmer's Manual
Name : WriteUsers
FOR PCBOARD 14.x ONLY
CALL WriteUsers(ErrCode)
WriteUsers will take the same variables used by ReadUsers and
write them back out to the users file. You MUST keep the variable
types correct. A small mistake could corrupt this user's record!
If you are using PCBoard 14.5, use WriteUserSYS instead, for a
safer method.
NOTE: Make sure to set UserFile$ to the path/directory/name of
the user file. You could input this from the config file
as a 5th line from it, but Door Source will not read it
and set it for you.
WARNING: Always make sure you have a ReadUsers somewhere in
your code before attempting to write again!
Example:
' $INCLUDE:'DOORSORC.INT'
PROGNAME$="ABCD"
RELEASE$="1.0"
CALL ClrScrn
INPUT #1, UserFile$
CLOSE #1
.
.
CALL ReadUsers(ErrCode)
.
.
CALL WriteUsers(ErrCode)
Door Source 3.1 - Page 34
Programmer's Manual
Script Commands
There is a routine that host several small routines in order to
provide handy dandy routines without using more bytes to make them
seperate calls. To call these routines set the shared variable
I1$ to the at least the first four letters of the script command
and call ScriptCMD.. Like this:
I$="PRES"
CALL ScriptCmd
The commands given by I1$ MUST be in ALL caps.
This would print a Press Any Key prompt and wait for a key to be
pressed before your program regains control.
The following pages are a list of them and examples:
Door Source 3.1 - Page 35
Programmer's Manual
Script Command : LTRIM
Ltrim will trim off the leading spaces on the left of a string.
So if you had a string that was " Hello", and ran that through
LTRIM, it would strip the spaces at the begining (not at the end, if
there are any) and it would look like "Hello".
Pass the string to be trimed in I2$ and the new string will be
returned in O1$
Door Source 3.1 - Page 36
Programmer's Manual
Script Command : RTRIM
Rtrim will trim off the trailing spaces on the right of a string.
So you could take the string " Hello " and Rtrim would return
in O1$ " Hello". Notice that the leading space at the begining
is NOT stripped off. This will only take from the right side of
a string.
Example :
I1$="RTRIM":I2$=" Hello There World! "
CALL ScriptCMD
CALL Send(O2$, No, Yes, 13)
Pass the string to be trimed in I2$ and the new string will be
returned in O1$
Door Source 3.1 - Page 37
Programmer's Manual
Script Command : UPPER
Upper will convert the string in I1$ to all uppercase and return
it in O1$. If you had "Hello TheRe.", you would get back "HELLO THERE."
Pass the string to be changed in I2$ and the new string will be
returned in O1$
Door Source 3.1 - Page 38
Programmer's Manual
Script Command : LOWER
Lower will convert the string you give it to all lower case. Give
it "HEllo ThERE EverYOne!" it would give you "hello there everyone!".
Example:
I1$="LOWER":I2$="hI ThEre EveRyOne!!"
CALL ScriptCMD
CALL Send(O2$, No, Yes, 11)
Pass the string to be changed in I2$ and the new string will be
returned in O1$
Door Source 3.1 - Page 39
Programmer's Manual
Script Command : MORE
More will print a more prompt and present the user with three choices.
O1$ will contain the choices and here is what it returns and what
they mean:
Y - See more of the file or what is on the screen
N - Stop displaying what is on the screen
C - Non-stop display mode
Example:
.
.
I1$="MORE"
CALL ScriptCMD
IF O1$="N" THEN GOTO ...
IF O1$="Y" THEN GOTO ...
.
.
More will return one of the three codes in O1$
Door Source 3.1 - Page 40
Programmer's Manual
Script Command : PRESS
Press will print a Press Any Key prompt and wait for the user to
press a key.
Press will need no variable passing.
Door Source 3.1 - Page 41
Programmer's Manual
Script Command : EXIST
Exist will check for the file name given in I2$ on the disk. If it
finds the file it will return in O1$ a "Y" otherwise it will return
a "N". It will find the first file that matches it in the current
directory (unless you specify a directory).
Example:
I1$="EXIST":I2$="GAME.DAT"
CALL ScriptCMD
IF O1$="N" THEN ....
.
.
Pass the filename to look for in I2$ and Exist will return a Y or N
in O1$ depending on if it found it.
Door Source 3.1 - Page 42
Programmer's Manual
Script Command : DAYOFTHEWEEK
DayOfTheWeek will return in O1$ a number from 1 to 7 telling you
what the day of the week is. 1=Sunday, 2=Monday,...,7=Saturday.
DayOfTheWeek will return a NUMBER in the STRING O1$.
Door Source 3.1 - Page 43
Programmer's Manual
Script Command : NAMECASE
NameCase will convert a name to it's proper case. If you give it
"DR. HOwaRD KAL Jr" it would give you "Dr. Howard Kal Jr".
Example:
I1$="NAME":I2$="MR. TOAD DE STOOL"
CALL ScriptCMD
CALL Send(O1$+" Correct?", No, Yes, 15)
Pass the name to be converted in I2$ and NameCase will return
the converted name in O1$
Door Source 3.1 - Page 44
Programmer's Manual
Script Command : CODER1 and CODER2
Coder1 is a routine to code and decode strings by using a password.
Coder1 will NOT generate control codes or graphic characters. DO
NOT use graphic characters in the password or results will be
unpredictable!
Coder2 is about the same as Coder1, BUT, it will generate graphic
characters. This is better suited to random access files, since a
EOF could pop up (In that case, use Coder1).
On both of these routines, the longer the password, the better
the protection. It will keep your data secure from casual attemps
to break it, but a longer, more complex password will keep your
data safer.
To decode the coded strings, run them through the coder routine
again, and the output will be the string, but de-coded.
Example:
Password$="#*&(JKJSF&^#^@"
Text$="If you can read this after coding, you can't read!"
I1$="CODER1":I2$=Text$:I3$=Password$
CALL ScriptCMD
Text$=O1$
(Print it)
.
.
I1$="CODER1":I2$=Text$:I3$=Password$
CALL ScriptCMD
Text$=O1$
(Print it again, but now it is decoded)
Door Source 3.1 - Page 45
Programmer's Manual
Script Command : ReverseBits
ReverseBits is a more simple way to code something, but easy to crack.
It will take each character in the string and reverse it's bits so
it will be the opposite of what it used to be. To change it back,
simply run it through the ReverseBits again and it will be normal.
Example:
Text$="This will go through simple coding"
I1$="REVERSEBITS":I2$=Text$
CALL ScriptCMD
Text$=O1$
(Code the string)
.
.
I1$="REVERSEBITS":I2$=Text$
CALL ScriptCMD
Text$=O1$
(Print it out decoded)
Door Source 3.1 - Page 46
Programmer's Manual
Name : ReverseChars
ReverseChars is a even simpliar routine to simply switch the characters
around (The first is last and the last is first...). This could be
used in conjunction with a Coder routine and Reversebits to make
a good coded string. To decode it, run it through the routine again
and the string will be normal again.
Example:
Text$="This will appear BACKWARDS!"
I1$="REVERSECHARS":I2$=Text$
CALL ScriptCMD
Text$=O1$
(Print it out)
Door Source 3.1 - Page 47
Programmer's Manual
Variables
Variables for your use and defination
ARG$ String containing input from INCOMM
SYSDPATH$ The FULL path\drive and name of PCBOARD.SYS
BBSNAME$ Name of the BBS running your door
SYSOPNM$ The sysop's full real name$
SYSFIRST$ The sysop's first name
SYSLAST$ The sysop's last name
SYSOP 1=Means the sysop is in the door
0=Means a normal user is in the door
CALLNAME$ The caller's full name
PROGNAME$ The door's name
RELEASE$ Version number of your door
USERF$ User's first name
USERL$ User's last name
I1$ and I2$ Input variables for script commands
O1$ and O2$ Output variables for script commands
YES Has a value of 1 which is used to mean YES
NO Has a value of 0 which is used to mean NO
Exit.Dor.1$ and The lines to be outputed as the closing message
Exit.Dor.2$ in the ExitDoor sub.
Exit.Dor.Clr1 and The color for the lines to be outputed in the
Exit.Dor.Clr2 ExitDoor sub.
Time.Left The amount of time left in minutes.
PARARRAY$(50) Parsing and sorting routine array.
* Caps 1=ALL input is to be cpnverted to UPPER CASE
0=All input stays as is (DEFAULT)
No.Enter.Send 1=Makes INCOMM NOT send a enter AFTER
input is completed
0=Makes INCOMM sned a enter AFTER input
has been completed. (DEFAULT)
* File.Missing$ This will be displayed which Viewfile can't
find the file it is looking for. (Default is
"File not found - Please report to sysop!")
HotKey Has a vaule of -1 to make INCOMM have a hotkey
affect for that input.
* Not.Around$ This is displayed if the page bell is off and
SysopPage is called.
ANSI 1=User is using ANSI graphics
0=User is not using ANSI graphics
BAUD 1=Local mode, but otherwise it will equal the
speed of the caller.
COMMPORT$ The comm port being using in COMx: format.
PARAM$ What Door Source received on the command line.
BlinkText This will cause the next Send called to display
the text in the color, but blinking when set
to 1. This will be reset to zero after use.
Tabspace This will cause the next Send called to space
over to the right this many times. It will be
reset to zero after it's use.
Network 1=Network is active
0=No Network is active
Node The node number of the node that is using
your door
* These variables are NOT reset to the default after they are used!
Door Source 3.1 - Page 48
Programmer's Manual
Variables (Cont.)
The following variables are what is returned and sent to ReadUsers and
WriteUsers subroutines. All are self-explanatory.
City.State$ Password$ Business.Phone$
Voice.Phone$ Last.Date.On$ Last.Logon.Time$
Expert.Mode$ Protocol.Type$ Last.Dir.Date$
Security.Level$ Times.On$ Page.Length$
Uploads$ Downloads$ Daily.Download.Bytes$
User.Comment$ Sysop.Comment$ Elasped.Time$
Subcription.Reg$ Subcription.Expire$ Area.Last.In$
Area.Reg$ Expired.Area$ User.Msg.To.Scan$
Total.Download.Bytes$ Total.Upload.Bytes$ Delete.Flag$
Last.Read$(0-39)
NOTE: The security levels are done by the ascii code. So it would be like
65 = A 32 = (space) 0 = (null)
You should use ASC(Security.Level$) to get the level number.
Door Source 3.1 - Page 49
Programmer's Manual
Programming using Door Source 3.1
Beginning your program
The begining of your program should have these first four lines
the same. This will start Door Source 3.1 in operation, and put
the status line on the bottom of the screen. The four lines are:
REM $INCLUDE: 'DOORSORC.INT'
PROGNAME$ = "(your program's full name)"
RELEASE$ = "(version number)"
CALL ClrScrn
Now, you should also remeber to close file number 1 right after the
ClrScrn. If you do need to get your own information from the
configuration file, then do all your inputing and close it.
NOTE: Besure to read "Some NEVERs" before writing your door!
Now you know some of the basics, but you should still read the
rest of the Programmer's Manual.
Temination of your door
You should always end your door with the ExitDoor subroutine.
It will handle all of the nessicary things. But you simply just
need to call ExitDoor at the end of your program, like this:
CALL ExitDoor
Also refer to Routines, and find ExitDoor. If you want to change the
color and make your own two line closing message, you will need to put
the color for the first line in Exit.Dor.Clr1 and for the second in
Exit.Dor.Clr2. The first line of the message should be in Exit.Dor.1$
and the second should be put in Exit.Dor.2$.
Loading Quick Basic 4.5
You can load QuickBasic 4.5 from the command line, but using the
batch file we have included, it will make it easier. Just type at
the DOS prompt :
LOADQB (door filename) (door configuration filename)
This will call up QuickBasic 4.5 already to go, and will also allow
you to run the door from the QuickBasic enviornment. You can also
do it this way :
QB (door filename) /L DOORSORC /CMD(door configuration filename)
Door Source 3.1 - Page 50
Programmer's Manual
Compiling, Linking, and executing your door
You can take advantage of QuickBasic 4.5 new features to the
fullest by being able to run your door in the QuickBasic enviornment.
To do this, make sure you have your testing configuration file setup
and your copy of PCBOARD.SYS in the directory you want it to be. Now
just run it by pressing F5!
After you have tested it in the QuickBasic enviornment long
enough, you can make the EXE version of your door very easily.
Simply press ALT-R and select Make EXE from the menu. Now set
the filename to what you want. Now you can choose to make your
door a "stand-alone" or one that needs a BRUN45.EXE module. The
difference between the two is that making it a stand-alone makes
the code a little larger (by about 20K) but needs no patched
BRUN45.EXE. If you compile the other way, your code will be
smaller, but you will need the patched BRUN45.EXE.
Support for several bbses
One of Door Source's advantages over some of the other door
writing utilities is that Door Source can support several versions
of PCBoard! The versions of PCBoard are 11.8 and up, including support
for 14.0 and up! The default bbs type is PCBoard 14.x. If you wish to
change that, simply put this into your enviorment table by using the
DOS command, SET.
SET DORSRC=PCB14 - Door Source will run PCBoard 14.x (DEFAULT)
SET DORSRC=PCB121 - Door Source will run PCBoard 11.8+ with COM1
SET DORSRC=PCB122 - Door Source will run PCBoard 11.8+ with COM2
Another way to change the setting for the bbs type is on the command
line, simply put PCB121 on the command line for PCBoard 11.8+ on
COM1 and PCB122 on the command line for PCBoard 11.8+ on COM2, like
this :
MYDOOR MYDOOR.CFG PCB121
You can't specify PCB14 on the command line, instead, Door Source
will default to it.
Door Source 3.1 - Page 51
Programmer's Manual
Door Source Tips
Here are some basic tips and important information in order for
you to program with Door Source 3.1! A couple just to remeber are:
1. Save your door often!
2. Before making the EXE version, make a backup of your QB code.
3. Have a copy of a local mode PCBOARD.SYS on hand and have your
testing configuration file locate it.
4. Use a variety of ANSI Colors and Door Source routines to make
your door appear more professional.
ANSI Graphics and Color
ANSI Graphics and Colors are made very easy to access in Door
Source 2.0. We have added a second way to call them. You can use
the normal BASIC numbers or you can use the word equalivent
0 - Black 8 - Gray
1 - Blue 9 - HiBlue
2 - Green 10 - HiGreen
3 - Cyan 11 - HiCyan
4 - Red 12 - HiRed
5 - Magenta 13 - HiMagenta
6 - Brown 14 - Yellow
7 - White 15 - HiWhite
You can type either of these as your color. They all have the same
realationship. Ansi Music can also be sent with the MusicG routine.
You just need vaild notes in the string you give it. It works just
like the BASIC PLAY command.
Paging the Sysop
Please ONLY page the sysop this way! You should use the SysopPage
routine to make the paging sound like the PCBoard paging. If the
sysop is NOT around, Door Source will output Not.Around$ to the user.
You can change Not.Around$ from it's default if you wish. Knowing
if the sysop is around or not matters on weather the page bell is on.
Do NOT beep the computer or page the sysop in ANY other way!
Door Source 3.1 - Page 52
Programmer's Manual
Some NEVERs
Unfortunely, there are some NEVERS to Door Source, just like any
thing else.
1. You should NEVER use these BASIC keywords in doors that you write with
Door Source 3.1:
LOCATE PRINT VIEW PRINT PRINT USING
DRAW END INKEY$ KEY
ON COM OPTION BASE PAINT PEN
PLAY RUN SCREEN SHELL
SOUND STRIG SYSTEM WIDTH
WINDOW STICK CLS
2. Never use a invalid color number or try to faul up Door Source
with invaild parameters.
3. Never disassemble the library.
Luckly, this covers most of them!
Door Source 3.1 - Page 53
Programmer's Manual
Door Source 3.1 in Operation
Door Source in Operation will have the status line on the
bottom the screen on line 24 and line 25. It will show these things:
1. The caller's baud rate
2. The caller's name
3. Time left in the door in minutes.
4. The name of your door and release version number.
5. Door Source 3.1
6. The time the door was entered, current time and flags if any.
7. Graphics mode (GR) or (NGR)
8. Bell/Caller alarm toggle status
The function keys open for the sysop to use are the following:
(F4) Page Bell Toggle
(F7) Caller Alarm Toggle
(F8) Return the user to the bbs
(F10) Start chat with user
(ESC) End chat with user
(ALT-X) Exit to DOS after sign-off toggle
(ALT-N) Sysop on next toggle
Door Source will automatically take care of all of these behind the
scenes, and elimnating the task of you having to look out for them.
Door Source 3.1 - Page 54
Programmer's Manual
Door Source 3.1 History and Credits
This history is taken from the previous doucmentations.
The first public release is version 1.45.
PRIVATE Version 1.0 - Beginning of Door Source
PRIVATE Version 1.1 - Put in ANSI graphics routines and also fixed some
bugs with in communacation with comm ports.
PRIVATE Version 1.2 - Started Script Commands and editing of the INCOMM
routine.
PRIVATE Version 1.3 - Threw out ANSI graphics routines and rewrote it.
Completed script commands. Fixed major but tiny bugs.
PRIVATE Version 1.4 - Threw out ANSI graphics routines again! Threw out
PCBOARD.SYS reading routines and put in ALT and
function key support. Added user base read/write
subroutines. Added save PCBOARD.SYS. Added Find First
routine. Added sorting and parsing routines.
PUBLIC Version 1.45- Fixed MAJOR read/write bug to the users file! Also
fixed MAJOR bug with Find First routine! PUBLIC
RELEASE number 1! Added BackSpaceOver sub and
fixed More and Press enter scripts to use BackSpaceOver
routine. Fixed a small chat bug.
PUBLIC Version 1.5 - Added Exit.Dor.Clr1 and Exit.Dor.Clr2 variables.
Fixed small bug with EXIST routines. Sped up INCOMM
slightly.
Version 1.6 - Version 1.9 skipped because of drastic changes in 2.0
PRIVATE Version 2.0B- Added viewfile, AllTrun, DayOfWeek, GetTime,
TimeConvert, ChkComm, ChkKeyboard, SysopPage,
Coder1, Coder2, ReverseBits, and ReverseChar
sub routines. Also added network detection and
multi-node support. BlinkText and Tabspace are
new Send variables. Added RandNum, MoveCursor,
Windows, HighScores, MenuManager, and FormatPrint
Also added support for PCBoard 11.8+.
PUBLIC Version 2.0 - Add BeepSpeaker and 14.5 support. Fixed minor
bugs and rewrote documentation
PUBLIC Version 2.2 - Added variable UserFile$ for I/O to user file.
Added abort for sysop page. Fixed a small bug in
MenuManager routine
PUBLIC Version 3.0 - Rewrote Window routine, fixed MoveCursor,
ClrScrn, and MenuManager bugs. Other minor
bugs fixed. Made all comm port handling done
by interrupts.
PUBLIC Version 3.1 - Added lock port handling and corrected locking
and unlocking of the user file
Credits
To Chuck Rouzer, who helped test from release 1.0 to 2.0!
To William Pendergast, who helped to beta test 2.0 and has
beta tested for me before.
To John Richardson, that gave the ideas for the pop-up windows and
scroll bar routines, and spotted some bugs I has over-looked in my
own testing doors.
To Mike Cleverly, who attempted to test door source, but some other
program crashed his board and he has not reopened as far as I know.
To David Basile, the first one to reply, and tested well to the last
day. David also helped with suggestions on the documentation.
To Premo Mondone, who helped test version 3.0 for bugs and high
speed problems. Premo has also give many ideas for improvments
upon Door Source
Door Source 3.1 - Page 55
Programmer's Manual
Problems and Copyrights
If you have any problems, feel free to write Computer City, USA
at the address on the form on the next page, or call the bbs. I
always would like to help solve any problems you might have, so
please contact me somehow.
Copyrights and Trademarks
QuickBasic (R) is a registered trademark of Microsoft Corporation
PCBoard (R) is a registered trademark of Clark Development Company (CDC)
MS-DOS (R) is a registered trademakr of Microsoft Corporation
BRUN45.EXE is copyrighted Microsoft Corporation, 1988
Door Source is Copyrighted Computer City, USA 1988, 1989, 1990
Send your registration card and license agreement to :
Computer City, USA
PO Box 77103
Greensboro, NC 27417-7103
ATTN: Door Source Registration
Door Source - Page 56
Programmer's Manual
Fill this form out for each door you write and mail it in. You can also
call the bbs at (919) 299-7935 and fill out Scipt Questionnaire #3 which
will ask the same questions as this form. For your first door you write
using Door Source, you will need to fill the form out and sign the
license aggrement. You should mail both of these in or call the
bbs. Also, if you have any suggestions for Door Source, please send them
along or leave me a comment on my bbs. ADDRESS ON PREVIOUS PAGE.
----------------------------------------------------------------------
: Door Source 3.1 - Door Registration Card :
: :
: Your full name: ________________________________________________ :
: :
: Street Adress : ________________________________________________ :
: :
: City, State, Zip : _____________________________________________ :
: :
: Phone number : _________________________________________________ :
: :
: Name of door(s) : ______________________________________________ :
: :
: Do you want this door listed in the listing of doors ? YES NO :
: :
: What type of door is this : ____________________________________ :
: :
: Are your going to charge for your door : NO $______ :
: :
: If you have a Door Source License, what is your Seiral Number :
: :
: S/N DS_______________ :
: :
: What version of Microsoft Quick Basic do you have : _________ :
----------------------------------------------------------------------
-----------------------------------------------------------------------
: License agreement: :
: :
: This license will let you distruibe Door Source 1.45 and up in your :
: door programs without having to give us any credit in any form. You :
: will receive a seiral number, which you should keep on hand and :
: we reserve the right to have you reveal your seiral number at :
: any time, and we will keep a copy of all registrations on hand. :
: If you do not sign the license agreement and send it in, you will :
: not be allowed to distubute any doors using Door Source 1.45 and :
: above. By signing this agreement, you will also receive a free :
: membership to PC - Systems Door Programming Group. This license :
: will also allow you to charge for your doors containing Door Source :
: 1.45 and above. Please include your address on a seperate sheet of :
: paper! :
: Sign Here : X_________________________________ :
-----------------------------------------------------------------------
Door Source 3.1 - Page 57
Programmer's Manual
A look ahead
I think that Door Source will quickly begin to be widely accepted
by many door authors that program in the Quick Basic field and door
authors who want more power, speed, and flexiablity than other door
packages provide.
Now if you had the 2.x documentation, you would see that
these features are supposed to be implemented by 3.1, but this is
3.1 simply because so much changed from 2.3 to this version. But
we couldnt get it all in and have a release out to fix the bad
compilation of 2.3, so look for these features in 4.0:
* Full support for DOOR.SYS and USERS.SYS in PCBoard 14.5
* Support for third party application fields in PCBoard 14.5
* Use of communacations ports 1, 2, 3, and 4
And one or two of these (but not for sure):
* Xmodem, Ymodem, and ASCII transfer protocols built in
* A viewer for PAK, ARC, and ZIP files built in
* Routines to read/write to message files
▓▒░ End of Door Source 3.1 Documentation ░▒▓